<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
    <div class="table-responsive">
        <table class="table table-bordered">
            <thead>
                <tr>
                    <th class="text-center"><div class="table-first-id">ID</div></th>
                    <th class="text-center" width="10%">推广员名称</th>
                    <th class="text-center" width="7%">级别</th>
                    <th class="text-center" width="10%">手机</th>
                    <th class="text-center" width="10%">累计成交数</th>
                    <th class="text-center" width="10%">累计成交金额</th>
                    <th class="text-center" width="10%">创建来源</th>
                    <th class="text-center" width="10%">上级推广员</th>
                    <th class="text-center" width="10%">创建时间</th>
                    <th class="text-center" width="8%">状态</th>
                    <th th:if="${typeTo}==null or ${typeTo}==''" class="text-center" width="10%">操作</th>
                </tr>
            </thead>
        </table>
        <div class="J_V_tabContent table-xScrollWrap">
            <table class="table table-bordered table-hover table-xs-content">
                <tbody>
                <tr class="jqgfirstrow" role="row">
                    <th class="text-center"><div class="table-first-id">&nbsp;</div></th>
                    <th class="text-center" width="10%">&nbsp;</th>
                    <th class="text-center" width="7%">&nbsp;</th>
                    <th class="text-center" width="10%">&nbsp;</th>
                    <th class="text-center" width="10%">&nbsp;</th>
                    <th class="text-center" width="10%">&nbsp;</th>
                    <th class="text-center" width="10%">&nbsp;</th>
                    <th class="text-center" width="10%">&nbsp;</th>
                    <th class="text-center" width="10%">&nbsp;</th>
                    <th class="text-center" width="8%">&nbsp;</th>
                    <th th:if="${typeTo}==null or ${typeTo}==''" class="text-center" width="10%">&nbsp;</th>
                </tr>
                <tr th:if="${#lists.isEmpty(dataMap['list'])}">
                    <td colspan="11" class="text-center">
                        <div class="noDataTipsBox">
                            <p><span class="c-4e fs16">亲，还没有数据~~~</span></p>
                        </div>
                    </td>
                </tr>
                <tr class="rowNum" th:if="!${#lists.isEmpty(dataMap['list'])}" th:each="agentUser : ${dataMap['list']}" th:attr="data-id=${agentUser['id']}">
                    <td class="text-center">
                        <div class="table-first-id">
                            <input type="checkbox" th:value="${agentUser['id']}" th:text="${agentUser['id']}" class="i-checks"/>
                        </div>
                    </td>
                    <td class="text-center" th:text="${agentUser['agentUserName']}"></td>

                    <td class="text-center" th:if="${agentUser['userType']}==1">一级</td>
                    <td class="text-center" th:if="${agentUser['userType']}==2">二级</td>

                    <td class="text-center" th:text="${#strings.isEmpty(agentUser['mobile'])}?'—':${agentUser['mobile']}"></td>
                    <td class="text-center" th:text="${agentUser['agentIncome']['orderNum']}"></td>
                    <td class="text-center" th:text="${agentUser['agentIncome']['orderSumPrice']}"></td>
                    <td class="text-center" th:if="${agentUser['createFrom']} == 1">代创建</td>
                    <td class="text-center" th:if="${agentUser['createFrom']} == 2">自申请</td>
                    <td class="text-center" th:text="${#maps.isEmpty(agentUser['parentAgentUser'])}?'—':${agentUser['parentAgentUser']['agentUserName']}"></td>
                    <td class="text-center" th:text="${#strings.substring(agentUser['createTime'],0,16)}"></td>
                    <td class="text-center" agentUserStatus>
                        <span th:if="${agentUser['status']} == 1" class="label label-warning">待提交</span>
                        <span th:if="${agentUser['status']} == 2" class="label label-primary">待审核</span>
                        <span th:if="${agentUser['status']} == 3" class="label label-info">正常</span>
                        <span th:if="${agentUser['status']} == 4" class="label label-danger">禁用</span>
                        <span th:if="${agentUser['status']} == 5" class="label label-default">驳回</span>
                    </td>
                    <td class="text-center" data-icon th:if="${typeTo}==null or ${typeTo}==''">
                        <a th:href="@{/admin/agent/user/agentUserInfo?agentUserId={agentUserId}(agentUserId=${agentUser['id']})}" class="c-master fs14" data-toggle="tooltip" data-placement="bottom" data-original-title="查看">
                            <i class="fa fa-eye"></i>
                        </a>

                        <!-- 修改 -->
                        <a th:if="${agentUser['userType']} == 1" th:href="@{/admin/agent/user/initUpdate1?agentUserId={agentUserId}&userType={userType} (agentUserId=${agentUser['id']},userType=${agentUser['userType']})}" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="修改">
                            <i class="fa fa-edit"></i>
                        </a>
                        <a th:if="${agentUser['userType']} == 2" th:href="@{/admin/agent/user/initUpdate2?agentUserId={agentUserId}&userType={userType} (agentUserId=${agentUser['id']},userType=${agentUser['userType']})}" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="修改">
                            <i class="fa fa-edit"></i>
                        </a>
                        <!-- 修改 -->

                        <a th:if="${agentUser['status']} == 1" agentUserStatus1 href="javascript:void(0);" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="提交">
                            <i class="fa fa-arrow-up"></i>
                        </a>
                        <a th:hidden="${agentUser['status']} != 2" agentUserStatus2 th:href="@{/admin/agent/user/initAduit?agentUserId={agentUserId}(agentUserId=${agentUser['id']})}" class="c-master fs14" data-toggle="tooltip" data-placement="bottom" data-original-title="审核">
                            <i class="fa fa-check"></i>
                        </a>
                        <a th:if="${agentUser['status']} == 3" agentUserStatus href="javascript:void(0);" class="c-master fs14 ml5"  data-toggle="tooltip" data-placement="bottom" data-original-title="禁用">
                            <i class="fa fa-unlock-alt"></i>
                        </a>
                        <a th:if="${agentUser['status']} == 4" agentUserStatus href="javascript:void(0);" class="c-master fs14 ml5"  data-toggle="tooltip" data-placement="bottom" data-original-title="恢复">
                            <i class="fa fa-history"></i>
                        </a>
                        <a th:if="${agentUser['status']} == 1 or ${agentUser['status']} == 5" agentUserStatus5 href="javascript:void(0);" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="删除">
                            <i class="fa fa-trash-o"></i>
                        </a>
                        <a  class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="查看收益详情">
                            <i class="fa fa-yen"></i>
                        </a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <!-- 分页，开始 -->
        <div data-th-replace="layout/adminPage"></div>
        <!-- 分页，结束 -->
    </div>
</html>